package com.yehongyu.mytools.ui.applet;

//: PrintDemoApplet.java
//Creating a Frame from within an Applet
import java.applet.*;
import java.awt.*;
import java.awt.event.*;

import com.yehongyu.mytools.ui.awt.PrintDemo;

public class PrintDemoApplet extends Applet {
	/**
	 * 
	 */
	private static final long serialVersionUID = 1L;

	public void init() {
		Button b = new Button("Run PrintDemo");
		b.addActionListener(new PDL());
		add(b);
	}

	class PDL implements ActionListener {
		public void actionPerformed(ActionEvent e) {
			final PrintDemo pd = new PrintDemo();
			pd.addWindowListener(new WindowAdapter() {
				public void windowClosing(WindowEvent e) {
					pd.dispose();
				}
			});
			pd.setSize(500, 500);
			pd.setVisible(true);
		}
	}
} // /:~
